﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Master/HomeMaster.Master"
    CodeBehind="List.aspx.cs" Inherits="CSP.Web.MyHome.Address.List" %>

<asp:Content ID="CSPHead" ContentPlaceHolderID="CSPHead" runat="server">
    <meta charset="utf-8">
    <title>地理位置管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
</asp:Content>
<asp:Content ID="CSPStyleAndScript" ContentPlaceHolderID="CSPStyleAndScript" runat="server">
    <link href="/Styles/lib/jquery-ui/jquery-ui-1.8.22.custom.css" rel="stylesheet" type="text/css" />
    <link href="/Styles/lib/jquery-ui/jquery.ui.button.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/UI/Jquery/jquery.ui.core.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.widget.min.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.position.min.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Jquery/jquery.ui.dialog.js" type="text/javascript"></script>
    <script src="/Scripts/UI/Expand/dialog.js" type="text/javascript"></script>
    <script language="javascript">
        function DeleteConfirm(id) {
            DialogMessage.Init("提示", "确定要删除此条信息？").dialog({
                resizable: false,
                width: 300,
                height: 140,
                modal: true,
                buttons: {
                    "确定": function () {
                        $(this).dialog("close");
                        $.ajax({
                            type: "get",
                            dataType: "json",
                            //data: { OrderNumber: ordernumber, ShipmentID:shipmentID, Notes: notes, Action: "CancelShipmentByID" },
                            url: "List.aspx?deleteid=" + id,
                            async: false,
                            error: function (result) {
                                result;
                            },
                            success: function (data, textStatus) {
                                data;
                                //执行成功
                                if (data.status == 1) {
                                    dilaogMessage(1, data.msg, function () {
                                        window.location.href = "List.aspx";
                                    });

                                }
                                else if (data.status == 2)//警告
                                {
                                    dilaogMessage(2, data.msg);
                                }
                                else {
                                    dilaogMessage(0, data.msg);
                                }
                            }
                        });

                    },
                    "取消": function () {
                        $(this).dialog("close");
                    }
                }
            });
        }

        //弹出message信息框 status=0错误,1成功，2警告
        function dilaogMessage(status, msg, fn) {

            //var dialogObj = $('<div id="dialog-message" title="Success"><span class="ui-icon ui-icon-circle-check" style="float: left; margin: 0 7px 50px 0;"></span><div>111</div></div>');
            //dialogObj.find("div").html(msg);
            var dialogObj;
            if (status == 0) {
                dialogObj = DialogMessage.Init("Error", msg);
            } else if (status == 1) {

                dialogObj = DialogMessage.Init("Successfully", msg);
            } else if (status == 2) {
                dialogObj = DialogMessage.Init("Warn", msg);
            }

            dialogObj.dialog({
                modal: true,
                buttons: {
                    确定: function () {
                        $(this).dialog("close");
                        fn();
                    }
                }
            });

        }
    </script>
</asp:Content>
<asp:Content ID="CSPCrumbs" ContentPlaceHolderID="CSPCrumbs" runat="server">
    <div class="crumbs">
        <span>您当前所在的位置：</span> <a href="/">首页</a> &gt; <a href="/MyHome/Account/Management.aspx">我的家园</a> &gt; <span>地理位置管理</span>
    </div>
    <!--crumbs-->
</asp:Content>
<asp:Content ID="CSPRight" ContentPlaceHolderID="CSPRight" runat="server">
    <div class="pr10">
        <div class="tabs tabs-home mt10">
            <div class="tabs-nd">
                <ul class="tabs-hd">
                    <li class="trigger current">地理位置管理</li>
                </ul>
            </div>
            <div class="tabs-bd">
                <div class="tabs-panel">
                    <p style="margin-top: 20px; text-align: right;">
                        <a href="Add.aspx" class="ui-btn-big sl-rc">
                            <span class="sl-rc-cnt">+新增地理位置</span></a></p>
                    <asp:Repeater ID="R_Address" ViewStateMode="Disabled" runat="server">
                        <HeaderTemplate>
                            <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table-style mtb15">
                                <thead>
                                    <tr>
                                        <th width="15%" scope="col">
                                            联系人
                                        </th>
                                        <th width="20%" align="left" scope="col">
                                            <div id="u78">
                                                <div id="u78_rtf">
                                                    <p>
                                                        所在地区</p>
                                                </div>
                                            </div>
                                        </th>
                                        <th width="31%" align="left" scope="col">
                                            <div id="u80">
                                                <div id="u80_rtf">
                                                    <p>
                                                        街道地址</p>
                                                </div>
                                            </div>
                                        </th>
                                        <th width="17%" align="left" scope="col">
                                            电话/手机
                                        </th>
                                        <th width="17%" scope="col">
                                            操作
                                        </th>
                                    </tr>
                                </thead>
                                <tbody>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td height="50" align="center">
                                    <a href="Detail.aspx?id=<%#Eval("Id")%>">
                                        <%#Eval("Name")%></a>
                                </td>
                                <td>
                                    <%#Eval("CN_Province")%>
                                    <%#Eval("CN_City") %>
                                    <%#Eval("CN_County")%>
                                </td>
                                <td>
                                    <%#Eval("Street") %>
                                </td>
                                <td align="left">
                                    <p>
                                        <%#Eval("Telephone")%></p>
                                    <p>
                                        <%#Eval("Mobile")%></p>
                                </td>
                                <td align="center" class="operate">
                                    <a href="Modify.aspx?modifyid=<%#Eval("id") %>">编辑</a> | <a href="javascript:DeleteConfirm('<%#Eval("id") %>')">
                                        删除</a>
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            <tr>
                                <td colspan="5" style="text-align: center">
                                    <asp:Label ID="LB_Empty" runat="server" Text=""><%=R_Address.Items.Count == 0 ? "暂无数据" : ""%></asp:Label>
                                </td>
                            </tr>
                            </tbody> </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </div>
                <!--tabs-panel-->
            </div>
            <!--tabs-bd-->
        </div>
        <!--tabs-->
    </div>
</asp:Content>
